package com.mobilous.client.project;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class DeleteAsk extends DialogBox {

	public DeleteAsk(final Widget widget) {
		setHTML("Delete Application");
		final DeleteAsk self = this;
		AbsolutePanel absolutePanel = new AbsolutePanel();
		setWidget(absolutePanel);
		absolutePanel.setSize("372px", "141px");
		
		Label lblDeletingTheApplication = new Label("Deleting the application will permenantly remove the application.");
		absolutePanel.add(lblDeletingTheApplication, 10, 10);
		
		Button btnThrashIt = new Button("Thrash it");
		absolutePanel.add(btnThrashIt, 295, 101);
		
		btnThrashIt.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				widget.removeFromParent();
				self.removeFromParent();
			}
		});
		
		Button btnCancel = new Button("Cancel");
		btnCancel.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				self.removeFromParent();
			}
		});
		absolutePanel.add(btnCancel, 10, 101);
	}
}
